package com.heima.wemedia;


import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 自媒体客户端启动类
 */
@SpringBootApplication
@MapperScan("com.heima.wemedia.mapper")
@EnableFeignClients("com.heima.*.feign")   //扫描fegin接口
@EnableDiscoveryClient //nacos注册服务于发现新版本不用写
@EnableAsync           //启动异步
@EnableScheduling      //定时任务
public class WemediaApplication {

    public static void main(String[] args) {
        SpringApplication.run(WemediaApplication.class, args);
    }

    /**
     * 创建MybatisPlus分页拦截器
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}
